home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_a
/
doswiz.doc
< prev
next >
Wrap
Text File
|
1995-04-22
|
17KB
|
558 lines
DOS WIZARD
Copyright 1983 by Gary C. Crider
INTRODUCTION
DOS WIZARD was written to
accomplish several tasks that no
other disk utility seemed to address.
Some of these are listed below. Some
knowledge of DOS file structures is
assumed. There are many good
tutorials on DOS available (see
BIBLIOGRAPHY). IT IS IMPORTANT THAT
YOU UNDERSTAND WHAT YOU ARE DOING
WHEN YOU USE DOS WIZARD. It will be
one of your handiest utilities, but
also one of the most potentially
dangerous if you don't understand it.
PLEASE READ THIS DOCUMENTATION
THOROUGHLY!
1. RECOVERING THE SECTORS THAT
JUST SEEM TO VANISH FROM DOS DISKS.
When a directory listing is produced,
the sum of all file sectors plus the
remaining free sectors should total
707. You have probably noticed that
this is not always true. The primary
cause for this is pressing SYSTEM
RESET while a file is open for
output. This leaves the directory
entry marked open and the file and
its associated sectors are forever
lost to DOS.
Prior to DOS WIZ the only way
to reclaim the sectors was to copy
all good files to another disk,
reformat the bad disk and selectively
copy each good file back to the
reformatted diskette.
DOS WIZ will read all files
while noting the sectors used by the
files. Any sector not referenced by a
file entry will be freed into the
available sectors pool and all open
file directory entries will be
released for reuse.
2. You probably have received
the notorious ERROR 164 or ERROR 144
at one time or another when trying to
read a disk file. Sometimes you can't
even delete a file because DOS wants
a valid file chain before he will
delete.
All sectors used by a DOS file
are chained together, that is, a
sector of data has a pointer to the
next sector belonging to that file.
Also on each sector is a reference to
the file which owns it. ERROR 164
indicates that a sector was pointed
to by a prior sector, but the two
sectors do not reference the same
file. This means that somehow
another file used a sector belonging
to the file in question. ERROR 144
generally indicates that a sector has
for some reason become unreadable.
This can also be the indicated by
some other error codes.
In either case, the integrity
of the file chain is lost and DOS
will not be able to read the file.
Usually there is nothing that can be
done because a binary load file or a
tokenized BASIC file that is not
complete will not be usable in any
fashion. However, recovering a
portion of a data file can be very
useful at times. It can prevent a lot
of re-entry of data. DOS WIZ allows
recovery of any file up to the point
where the chain is broken. This then
becomes a valid DOS file and can once
again be accessed.
3. A bad sector on a disk is
often a big headache even when your
file is backed up. It means that all
good files must be copied and the
disk reformatted and the good files
copied back. Only then can you
restore your file from the backup.
DOS WIZ allows another approach
that is very often successful. You
can analyze the disk to get the
location of the bad sector and it's
associated file name. You can then
write zeros to that sector and the
odds are very good that you will then
be able to read it again. If you
can't you haven't lost anything since
the sector was unreadable. You may
then recover the file up to the point
of the zero sector and then delete
the file. Now you can recover the
sectors used by the file and then
rewrite your backup file to the disk.
It sounds complicated, but is really
quite simple and much easier than the
alternative discussed earlier.
4. Occasionally a file gets
deleted by mistake. If the sectors
used by that file have not been
overwritten, DOS WIZ will allow easy
recovery of the file.
5. Sometimes you end up with two
or more files of the same name. If
you delete or rename one with DOS,
all files with that name are deleted
or renamed. DOS WIZ lets you delete
or rename by file number. There are
never duplicate file numbers.
6. DOS WIZARD provides a
translation of the sector bit map
from the VTOC that is easily
readable. It allows you to "hide"
sectors from use by DOS by marking
them as allocated. You can also free
allocated sectors.
7. DOS WIZARD's directory
listing lists ALL entries including
deleted and open files. It allows
you to perform many DOS functions on
those files by simply referencing the
file number. This does however
eliminate the use of wild cards. The
directory listing also tells you at a
glance whether any sectors are
unaccounted for.
8. DOS WIZARD will allow you to
flag sectors as allocated and
effectively hide them from DOS so
that they will be reserved for your
use.
9. DOS WIZARD can be used to
clear unused sectors of data. This
will speed up the disk duplication
process when FASTDUP (Copyright 1982
by Gary C. Crider) is used.
10. DOS WIZARD will display
sectors in hex and ASCII on the same
screen. It also gives much valuable
information about that sector such as
the file to which it belongs.
11. DOS WIZARD will list all
extents by sector range which are
occupied by a given file. An extent
is a set of contiguous sectors.
PRINTING THE DOSWIZ DOCUMENTATION
Running the DOSWIZ.PRT program
using BASIC will print the
DOSWIZ.DOC file in 1.75 width letters
on a STAR (tm) GEMINI series printer.
It may work on other printers as
well.
Another way to print it would be
to use the COPY feature of your DOS
or DUP.SYS utility, specifying P: as
the output file name. It can also be
printed from most word processors.
The actual GEMINI control characters
for page skipping are imbedded in the
text. If you have a different brand
of printer, you may want to change
them. They should work okay on the
EPSON (tm) printers.
A DISKETTE ANALYSIS
This MENU option performs a
two-stage analysis of the contents of
a DOS format diskette. Either stage
may be interrupted by pressing the
ESC key, but any statistics will only
be valid up to the point where the
interrupt occurred.
Stage 1 reads all DOS files
which are not marked as deleted or
open and verifies that the chain is
intact. All chain errors are reported
with the sector number where the
violation occurred and the file name
for the chain being validated. A
chain error is reported if:
a) The file number in the sector
does not reflect the file being
validated;
b) The next sector pointer does
not point to a valid sector number;
c) The sector is not marked as
allocated in the VTOC;
d) A read error occurs while
trying to read the sector;
e) The byte count in the sector
is less than 1 or greater than 125.
Stage 1 reports the following
counts:
1. VALID FILES - the number of
files which are accessible by DOS and
contain no chain errors.
2. DELETED FILES - the number of
directory entries flagged as deleted.
3. OPEN FILES - the number of
directory entries flagged as open.
4. BAD CHAINS - the number of
files which were found to have
invalid chains.
5. SECTORS ALLOCATED - the
number of sectors which are marked as
allocated in the Volume Table Of
Contents (VTOC).
6. FREE SECTORS - the number of
sectors marked as not allocated in
the VTOC.
7. DEAD SECTORS - the number of
sectors allocated less the number of
sectors validated while verifying
chains. These sectors cannot be
referenced by DOS.
Stage 2 reads every sector on
the diskette and reports the count of
sectors containing no data (ZERO
SECTORS) and the count of sectors
which could not be read (BAD
SECTORS).
Stage 2 will list by sector
number the first 64 bad sectors
encountered. If there are more than
64 and you need to know where they
are, consider using FASTDUP.
C CHANGE DISKETTES
This function must be performed
before processing a different
diskette since the VTOC and directory
are re